﻿@using ForzaGT3.Data
@model IEnumerable<Gallery>
@{
    ViewBag.Title = "Index";
    int pagingSize = 16;
    int CurrentPage = 1;
}
<div class="contentheader header shadow">
    GALLERY
</div>
<div class="greybgtxt">
    <div class="greyfull">
        @*<div id="filter">
            <select>
                <option>All Seasons</option>
                <option>All Seasons1</option>
                <option>All Seasons2</option>
                <option>All Seasons3</option>
            </select>
            <select>
                <option>All Events</option>
                <option>All Events1</option>
                <option>All Events2</option>
                <option>All Events3</option>
            </select>
        </div>*@
        <div id="gallerycontent">
            @if (Model != null)
            {
                foreach (Gallery data in Model)
                {
                <a href='@Url.Content("~" + data.Url)' class='lightview'
                    data-lightview-group='Gallery' data-lightview-title="@data.Title" data-lightview-caption="@data.Caption"
                    style="background-image: url(@Url.Content("~" + data.ThumbUrl))"></a>
                }
            }
        </div>
        @if (Model.Count() > pagingSize)
        {
            bool HasNext = false;
            bool HasPrev = false;

            decimal hasilBagi = Model.Count() / pagingSize;


            if (CurrentPage == 1)
            {
                HasNext = true;
            }

            if (CurrentPage > 1)
            {
                HasPrev = true;
            }
            
            <div id="paging">
                <a href="#">First Page</a>
                @if (HasPrev)
                {
                    <a href="#">Previous</a> 
                }
                <a href="#" class="number"><<</a> <a href="#" class="number">1</a> <a href="#" class="number">
                    2</a> <a href="#" class="number">3</a> <a href="#" class="number">>></a> <a href="#">
                        Next</a> <a href="#">Last Page</a>
            </div>
        }
    </div>
</div>
